<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Docker使用入门 | CodingDGSun's Blog</title><meta name="author" content="CodingDGSun"><meta name="copyright" content="CodingDGSun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Docker官网地址https:&#x2F;&#x2F;www.docker.com docker镜像常用命令1docker version      &#x2F;&#x2F;查看版本  1docker --help       &#x2F;&#x2F;查看帮助  1docker images --help        &#x2F;&#x2F;查看镜像帮助  1docker search --help        &#x2F;&#x2F;查看搜索帮助  1docker search mysq">
<meta property="og:type" content="article">
<meta property="og:title" content="Docker使用入门">
<meta property="og:url" content="https://sunjie23.gitee.io/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/index.html">
<meta property="og:site_name" content="CodingDGSun&#39;s Blog">
<meta property="og:description" content="Docker官网地址https:&#x2F;&#x2F;www.docker.com docker镜像常用命令1docker version      &#x2F;&#x2F;查看版本  1docker --help       &#x2F;&#x2F;查看帮助  1docker images --help        &#x2F;&#x2F;查看镜像帮助  1docker search --help        &#x2F;&#x2F;查看搜索帮助  1docker search mysq">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg">
<meta property="article:published_time" content="2021-12-13T06:43:08.000Z">
<meta property="article:modified_time" content="2021-12-13T06:43:51.562Z">
<meta property="article:author" content="CodingDGSun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg"><link rel="shortcut icon" href="/codingdgsun/img/favicon.png"><link rel="canonical" href="https://sunjie23.gitee.io/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/codingdgsun/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/codingdgsun/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Docker使用入门',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-12-13 14:43:51'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/codingdgsun/atom.xml" title="CodingDGSun's Blog" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div></div><hr/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/codingdgsun/">CodingDGSun's Blog</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Docker使用入门</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2021-12-13T06:43:08.000Z" title="Created 2021-12-13 14:43:08">2021-12-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2021-12-13T06:43:51.562Z" title="Updated 2021-12-13 14:43:51">2021-12-13</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Docker使用入门"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="Docker官网地址"><a href="#Docker官网地址" class="headerlink" title="Docker官网地址"></a>Docker官网地址</h2><p><a target="_blank" rel="noopener" href="https://www.docker.com/">https://www.docker.com</a></p>
<h2 id="docker镜像常用命令"><a href="#docker镜像常用命令" class="headerlink" title="docker镜像常用命令"></a>docker镜像常用命令</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker version      //查看版本</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-01.415zr53dpts0.jpg" alt="62-01"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker --help       //查看帮助</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-02.kfqlz8jhytc.jpg" alt="62-02"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker images --help        //查看镜像帮助</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-03.1coruy66sf5s.jpg" alt="62-03"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search --help        //查看搜索帮助</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-04.26y2x6k0v5es.jpg" alt="62-04"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search mysql     //搜索镜像，比如：mysql</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-05.36pznh0szjk0.jpg" alt="62-05"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search mysql --filter=STARTs=6000        //过滤搜索STARS大于6000的镜像</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-06.3j9g4c8p9hw0.jpg" alt="62-06"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull --help      //查看下载镜像帮助</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-07.2a0r639sx0kk.jpg" alt="62-07"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull mysql       //下载最新镜像mysql</span><br></pre></td></tr></table></figure>

<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-08.296iy0qqxzk0.jpg" alt="62-08"></p>
<p>查看<a target="_blank" rel="noopener" href="https://registry.hub.docker.com/">dockerhub</a>里面的镜像版本</p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-09.5d9z3ljbxfk0.jpg" alt="62-09"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull mysql:5.7       //下载指定版本的镜像mysql，版本需在dockerhub里面存在</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-10.72nb66io24w0.jpg" alt="62-10"></p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-11.6k38cqtn7fk0.jpg" alt="62-11"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker images       //查看镜像</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-12.92oza0qzxb.jpg" alt="62-12"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker rmi --help      //查看删除镜像帮助</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-13.2rnnf6ca5920.jpg" alt="62-13"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker images -aq       //查看所有镜像的ID</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-14.1s3bmszpg8hs.jpg" alt="62-14"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker rmi [imageId]     //删除指定镜像</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-15.6qrs2dvzrrk0.jpg" alt="62-15"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker rmi -f $(docker images -aq)      //删除所有镜像</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-16.2w5btq7eqa80.jpg" alt="62-16"></p>
<h2 id="docker容器常用命令"><a href="#docker容器常用命令" class="headerlink" title="docker容器常用命令"></a>docker容器常用命令</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull centos      //下载一个centos镜像</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-17.6nvpbax9gkg0.jpg" alt="62-17"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">docker run [可选参数] image     //新建容器并启动</span><br><span class="line"></span><br><span class="line">--name=&quot;容器别名&quot;       //给容器起个别名</span><br><span class="line">-d      //后台运行</span><br><span class="line">-it     //使用交互方式运行</span><br><span class="line">-p      //指定容器端口</span><br><span class="line">    -p ip:主机端口:容器端口</span><br><span class="line">    -p 主机端口:容器端口</span><br><span class="line">    -p 容器端口</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-18.5ru73rw16i80.jpg" alt="62-18"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">exit        //退出容器并停止容器</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-19.579ju8xo2p40.jpg" alt="62-19"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">docker ps       //列出当前正在运行的容器</span><br><span class="line"></span><br><span class="line">        -a      //列出当前正在运行的容器和历史上运行过的容器</span><br><span class="line">        -n=?    //显示最近创建的容器</span><br><span class="line">        -q      //只显示容器的编号</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-20.23qkzey7f6v4.jpg" alt="62-20"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Ctrl + p + q        //退出容器但不停止容器</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-21.g6mlfuvvodc.jpg" alt="62-21"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">docker rm 容器Id        //删除指定容器，但正在运行的，不能删除；如果强制删除需加参数 rm -f</span><br><span class="line">docker rm -f $(docker ps -aq)       //删除所有容器</span><br><span class="line"></span><br><span class="line">docker ps -aq |xargs docker rm//删除所有容器</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-22.750rz3gz2qc0.jpg" alt="62-22"></p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-23.6wfi24o9a500.jpg" alt="62-23"></p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-24.3h51fhghx0y0.jpg" alt="62-24"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">docker start 容器Id     //启动停止的容器</span><br><span class="line">docker restart 容器Id     //重启容器</span><br><span class="line">docker stop 容器Id     //停止正在运行的容器</span><br><span class="line">docker kill 容器Id     //强制停止容器</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-25.201y9mdlf9i8.jpg" alt="62-25"></p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-26.691txesdw5o0.jpg" alt="62-26"></p>
<h2 id="docker其他命令"><a href="#docker其他命令" class="headerlink" title="docker其他命令"></a>docker其他命令</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -d 镜像      //启动一个镜像；如果容器启动后，发现没有提供服务，就会立即停止</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-27.6d9yhut1vac0.jpg" alt="62-27"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -d --name=&quot;myCentOS&quot; centos /bin/bash  -c &quot;while true; do echo helloworld;sleep 1;done&quot;      //后台运行一个输出服务程序</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-28.6fht91dgbyo0.jpg" alt="62-28"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker logs -tf --tail 5 容器Id       //查看镜像程序日志</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-29.530xjr8n1as0.jpg" alt="62-29"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker top 容器Id     //查看容器内部的进程信息</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-30.44tce0hx0y20.jpg" alt="62-30"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker inspect 容器Id       //查看容器的元数据</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-31.6cqxfsjsdeo.jpg" alt="62-31"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it 容器Id /bin/bash      //进入正在运行的容器，开启一个新的终端，可以在里面进行操作</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-32.21365yeowiow.jpg" alt="62-32"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker attach 容器Id        //进入容器正在执行的终端，不会启动新的进程</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-33.xtthcqm0we8.jpg" alt="62-33"></p>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-34.5ybgibnh4d80.jpg" alt="62-34"></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker cp 447ff6c195c3:/home/helloworld.txt /Users/sunjie/Desktop       //将容器里面的文件拷贝到宿主机</span><br></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/62-35.6qotq3sog340.jpg" alt="62-35"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="mailto:undefined">CodingDGSun</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="https://sunjie23.gitee.io/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/">https://sunjie23.gitee.io/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/codingdgsun/2021/12/14/Docker%E4%B8%8A%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1%E5%BA%94%E7%94%A8/"><img class="prev-cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="onerror=null;src='/codingdgsun/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">Previous Post</div><div class="prev_info">Docker上部署服务应用</div></div></a></div><div class="next-post pull-right"><a href="/codingdgsun/2021/07/29/Windows%E4%B8%8ADos%E5%91%BD%E4%BB%A4%E6%93%8D%E4%BD%9C%E6%96%87%E4%BB%B6%E5%8F%8A%E6%96%87%E4%BB%B6%E5%A4%B9/"><img class="next-cover" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="onerror=null;src='/codingdgsun/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">Next Post</div><div class="next_info">Windows上Dos命令操作文件及文件夹</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">CodingDGSun</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div><a class="button--animated" id="card-info-btn" href="https://sunjie23.gitee.io/codingdgsun"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>Catalog</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Docker%E5%AE%98%E7%BD%91%E5%9C%B0%E5%9D%80"><span class="toc-number">1.</span> <span class="toc-text">Docker官网地址</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#docker%E9%95%9C%E5%83%8F%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"><span class="toc-number">2.</span> <span class="toc-text">docker镜像常用命令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#docker%E5%AE%B9%E5%99%A8%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"><span class="toc-number">3.</span> <span class="toc-text">docker容器常用命令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#docker%E5%85%B6%E4%BB%96%E5%91%BD%E4%BB%A4"><span class="toc-number">4.</span> <span class="toc-text">docker其他命令</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目build失败之MiniCssExtractPlugin"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin">React项目build失败之MiniCssExtractPlugin</a><time datetime="2022-01-17T06:03:03.000Z" title="Created 2022-01-17 14:03:03">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目构建常用命令"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令">React项目构建常用命令</a><time datetime="2022-01-17T06:01:56.000Z" title="Created 2022-01-17 14:01:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Mac OS初始化一个React项目"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目">Mac OS初始化一个React项目</a><time datetime="2022-01-17T05:58:21.000Z" title="Created 2022-01-17 13:58:21">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="MySQL语法入门（二）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）">MySQL语法入门（二）</a><time datetime="2022-01-17T05:54:56.000Z" title="Created 2022-01-17 13:54:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题二（简单）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）">Java中常见面试题二（简单）</a><time datetime="2022-01-17T05:53:56.000Z" title="Created 2022-01-17 13:53:56">2022-01-17</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By CodingDGSun</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/codingdgsun/js/utils.js"></script><script src="/codingdgsun/js/main.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>